class Solution(object):
    def removeOccurrences(self, s, part):
        index = 0
        m = len(part)
        while index + m <= len(s):
            if s[index: index + m] == part:
                s = s[:index] + s[index + m:]
                index = 0
            else:
                index += 1
        return s

